<?=html::script('../js/validator.js')?>
<?=html::script('../js/fckeditor/fckeditor.js')?>
<?=html::script('../js/jscalendar/calendar.js')?>
<?=html::script('../js/jscalendar/lang/calendar-'.$this->lang.'.js')?>
<?=html::script('../js/jscalendar/calendar-setup.js')?>
<?=html::link('../js/jscalendar/calendar-win2k-2.css', 'stylesheet', 'text/css')?>
<?php $title = 'title_'.$this->lang; ?>

<form action="" method="post" class="form" enctype="multipart/form-data" onsubmit="return Validator.Validate(this,1)">
<table class="">
	<caption>新建日历事件</caption>
	<tr>
		<th><label for="category">分类 <em>*</em></label></th>
		<td><select name="category_id" dataType="Require" msg="请选择Events分类">
			<option value="">-</option>
			<?php foreach($categories as $item) { ?>
			<option value="<?=$item->id?>" <?=($event->category_id == $item->id) ? 'selected="selected"' : ''?>><?=$item->$title?></option>
			<?php } ?>
		</select></td>
	</tr>
	<tr>
		<th><label for="name" >Name</label></th>
		<td><input type="text" id="name" name="name" value="<?=$event->name?>" class="textbox" /></td>
	</tr>
	<tr>
		<th><label for="title" >标题 <em>*</em></label></th>
		<td><input type="text" id="title" name="title" value="<?=$event->title?>" dataType="Require" msg="请输入事件标题" /></td>
	</tr>
	<tr>
		<th><label for="title" >日期 <em>*</em></label></th>
		<td>开始: <input type="text" name="start_date" readonly="readonly" value="<?=($event->start_date) ? $event->start_date : date('Y-m-d')?>" id="f_date_a" style="width: 100px;"/> 结束: <input type="text" name="end_date" readonly="readonly" value="<?=$event->end_date?>" id="f_date_b" style="width: 100px;"/></td>
	</tr>
	<tr>
		<th><label for="title" >时间 </label></th>
		<td>开始: <?=mydate::select_time('start_time', $event->start_time)?> 结束: <?=mydate::select_time('end_time', $event->end_time)?></td>
	</tr>
	<tr>
		<th><label for="event_content" >内容</label></th>
		<td><script type="text/javascript">
			<!--
			var sBasePath = document.location.href.substring(0,document.location.href.lastIndexOf('/admin/')) ;
			
			var oFCKeditor = new FCKeditor( "event_content" ) ;
			oFCKeditor.BasePath	= "<?=url::base()?>../js/fckeditor/";
			oFCKeditor.ToolbarSet = "Basic";
			oFCKeditor.Height	= 300 ;
			oFCKeditor.Value	= '<?=str_replace(array("\r\n", "\n", "\r"), array("","",""), "")?>';
			oFCKeditor.Create() ;
			//-->
		</script></td>
	</tr>
	<tr>
		<th></th>
		<td><input type="submit" name="submit" value="Submit" /></td>
	</tr>
</table></form>
<script type="text/javascript">
    Calendar.setup({
        inputField     :    "f_date_a",  
        ifFormat       :    "%Y-%m-%d"
    });
    Calendar.setup({
        inputField     :    "f_date_b",  
        ifFormat       :    "%Y-%m-%d"
    });
</script>